﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CoreEx.Database.Metadata;

namespace CoreEx.Database.MetaData.Implementation
{
    [Serializable]
    public class RelationInfo : IRelationInfo
    {
        public IPrimaryKeyInfo PrimaryKey { get; set;}        
        public IForeignKeyInfo ForeignKey { get; set;}

        public override string ToString()
        {
            if (PrimaryKey != null && ForeignKey != null)
                return string.Format("{0} -> {1}", ForeignKey.Name, PrimaryKey.Name);
            return base.ToString();
        }
    }
}
